<?php
// +----------------------------------------------------------------------
// | 产品管理首页
// +----------------------------------------------------------------------
// | Copyright (c) 2015
// +----------------------------------------------------------------------
// | Author: baiping 125618036@qq.com http://www.webipcode.com
// +----------------------------------------------------------------------
// |2015-11-12 下午2:30:12
// +----------------------------------------------------------------------
?>
<?php $catid_arr = array(157,158,163); ?>
<?php $this->load->view('public/header');?>
<?php $this->load->view('public/head');?>
<div class="container-fluid">
	<div class="row">
		<?php $this->load->view('public/sideleft');?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
			<!-- 内容区 -->
			<div class="main-title">
				<h3>
					<?php echo $meta_title; ?>
				</h3>
			</div>
			<div class="con">
				<div class="cf">
					<div class="pull-left">
						<a href="<?php echo site_url('catgory/add')?>" class="btn btn-primary">新增</a> 
					</div>
				</div>
				<div class="clearfix"></div>
				<!-- 内容列表 -->
				<?php if ( $record_count > 0 ){?>
				<table class="table table-striped table-hover ">
					<thead>
						<tr>
							<!-- <th class="row-selected"><input class="checkbox check-all" type="checkbox"></th> -->
							<th>ID</th>
							<th>分类名称</th>
							<th>添加子栏目</th>
							<th>是否显示</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php foreach($catgory as $key => $val){?>
					<tr>
						<!-- <td><input class="ids row-selected" type="checkbox" value="<?php echo $val['id']; ?>" name="id[]"></td> -->
						<td><?php echo $val['id'];?></td>
						<td><small><?php echo $val['title_show'];?></small></td>
						<td><a href="<?php echo site_url('catgory/add/'.$val['id'])?>" class="btn btn-primary btn-xs">添加子栏目</a></td>
						<td>
							<?php if(!$val['hide']){?>
							　<a class="label label-primary confirm ajax-get" href="<?php echo site_url('catgory/changstate?state=1&id='.$val['id'].'/')?>">是</a>
							<?php }else{?>
							　<a class="label label-warning confirm ajax-get" href="<?php echo site_url('catgory/changstate?id='.$val['id'].'/')?>">否</a>
							<?php }?>
						</td>
						<td>
						<?php if( !in_array($val['id'], $catid_arr) ){ ?>
							<a href="<?php echo site_url('catgory/modfiy/'.$val['id']);?>">修改</a>
							<a href="<?php echo site_url('catgory/del?id='.$val['id']);?>" class="confirm ajax-get">删除</a>
						<?php }else{?>
							--
						<?php }?>	
						</td>
					</tr>
					<?php }?>
					<tr>
						<td colspan="7">
							<ul class="pagination">
								<li><span>共<?php echo $record_count?>条记录</span></li>
							</ul>
						</td>
					</tr>
				</table>
				<?php }else{?>
				<div class="alert alert-warning" role="alert">哦亲！暂无数据</div>
				<?php }?>	
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//左侧菜单高亮显示
highlight_subnav( '<?php echo site_url('config/index')?>' );
</script>
<?php $this->load->view('public/footer');?>